

<!doctype html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>skidl.tools.spice.spice module &#8212; SKiDL 1.2.2 documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/bizstyle.css?v=a66e137f" />
    
    <script src="../_static/documentation_options.js?v=fd7cadf9"></script>
    <script src="../_static/doctools.js?v=9a2dae69"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../_static/bizstyle.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <!--[if lt IE 9]>
    <script src="_static/css3-mediaqueries.js"></script>
    <![endif]-->
  </head><body>
    <h1 id="site-title"><a href="../../../"><img src="../../../images/slim_banner.png" width="100%"></a></h1>
    
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">SKiDL 1.2.2 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">skidl.tools.spice.spice module</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="module-skidl.tools.spice.spice">
<span id="skidl-tools-spice-spice-module"></span><h1>skidl.tools.spice.spice module<a class="headerlink" href="#module-skidl.tools.spice.spice" title="Link to this heading">¶</a></h1>
<p>Handler for reading SPICE libraries.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.DeviceModel">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">DeviceModel</span></span><a class="headerlink" href="#skidl.tools.spice.spice.DeviceModel" title="Link to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#skidl.tools.spice.spice.XspiceModel" title="skidl.tools.spice.spice.XspiceModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">XspiceModel</span></code></a></p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.Parameters">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">Parameters</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#Parameters"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.Parameters" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3.11/library/stdtypes.html#dict" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
<p>Class for holding Spice subcircuit parameters.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.XspiceModel">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">XspiceModel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#XspiceModel"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.XspiceModel" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3.11/library/functions.html#object" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Object to hold the parameters for an XSPICE model.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.add_part_to_circuit">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">add_part_to_circuit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">part</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">circuit</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#add_part_to_circuit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.add_part_to_circuit" title="Link to this definition">¶</a></dt>
<dd><p>Add a part to a PySpice Circuit object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>part</strong> – SKiDL Part object.</p></li>
<li><p><strong>circuit</strong> – PySpice Circuit object.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.add_subcircuit_to_circuit">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">add_subcircuit_to_circuit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">part</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">circuit</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#add_subcircuit_to_circuit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.add_subcircuit_to_circuit" title="Link to this definition">¶</a></dt>
<dd><p>Add a .SUBCKT part to a PySpice Circuit object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>part</strong> – SKiDL Part object.</p></li>
<li><p><strong>circuit</strong> – PySpice Circuit object.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.add_xspice_io">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">add_xspice_io</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">part</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">io</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#add_xspice_io"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.add_xspice_io" title="Link to this definition">¶</a></dt>
<dd><p>Add XSPICE I/O to the pins of a part.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.add_xspice_to_circuit">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">add_xspice_to_circuit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">part</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">circuit</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#add_xspice_to_circuit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.add_xspice_to_circuit" title="Link to this definition">¶</a></dt>
<dd><p>Add an XSPICE part to a PySpice Circuit object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>part</strong> – SKiDL Part object.</p></li>
<li><p><strong>circuit</strong> – PySpice Circuit object.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.convert_for_spice">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">convert_for_spice</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">part</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">spice_part</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pin_map</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#convert_for_spice"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.convert_for_spice" title="Link to this definition">¶</a></dt>
<dd><p>Convert a Part object for use with SPICE.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>part</strong> – SKiDL Part object that will be converted for use as a SPICE component.</p></li>
<li><p><strong>spice_part</strong> (<a class="reference internal" href="skidl.part.html#skidl.part.Part" title="skidl.part.Part"><em>Part</em></a>) – The type of SPICE Part to be converted to.</p></li>
<li><p><strong>pin_map</strong> (<a class="reference external" href="https://docs.python.org/3.11/library/stdtypes.html#dict" title="(in Python v3.11)"><em>dict</em></a>) – Dict with pin numbers/names of part as keys and num/names of spice_part pins as replacement values.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.default_lib_paths">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">default_lib_paths</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#default_lib_paths"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.default_lib_paths" title="Link to this definition">¶</a></dt>
<dd><p>Return default list of directories to search for part libraries.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.gen_netlist">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">gen_netlist</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">self</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#gen_netlist"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.gen_netlist" title="Link to this definition">¶</a></dt>
<dd><p>Return a PySpice Circuit generated from a SKiDL circuit.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>title</strong> – String containing the title for the PySpice circuit.</p></li>
<li><p><strong>libs</strong> – String or list of strings containing the paths to directories
containing SPICE models.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.get_fp_lib_tbl_dir">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">get_fp_lib_tbl_dir</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#get_fp_lib_tbl_dir"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.get_fp_lib_tbl_dir" title="Link to this definition">¶</a></dt>
<dd><p>Get the path to where the global fp-lib-table file is found.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.load_sch_lib">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">load_sch_lib</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">self</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lib_search_paths_</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lib_section</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#load_sch_lib"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.load_sch_lib" title="Link to this definition">¶</a></dt>
<dd><p>Load the .subckt I/O from a SPICE library file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> – The name of the SPICE library file.</p></li>
<li><p><strong>lib_search_paths</strong> – List of directories to search for the file.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.node">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">net_pin_part</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#node"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.node" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.not_implemented">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">not_implemented</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">part</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">circuit</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#not_implemented"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.not_implemented" title="Link to this definition">¶</a></dt>
<dd><p>Unable to add a particular SPICE part to a circuit.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.tools.spice.spice.parse_lib_part">
<span class="sig-prename descclassname"><span class="pre">skidl.tools.spice.spice.</span></span><span class="sig-name descname"><span class="pre">parse_lib_part</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">self</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">partial_parse</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/tools/spice/spice.html#parse_lib_part"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.tools.spice.spice.parse_lib_part" title="Link to this definition">¶</a></dt>
<dd><p>Create a Part using a part definition from a SPICE library.</p>
</dd></dl>

</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <div>
    <h3><a href="../index.html">Table of Contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">skidl.tools.spice.spice module</a><ul>
<li><a class="reference internal" href="#skidl.tools.spice.spice.DeviceModel"><code class="docutils literal notranslate"><span class="pre">DeviceModel</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.Parameters"><code class="docutils literal notranslate"><span class="pre">Parameters</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.XspiceModel"><code class="docutils literal notranslate"><span class="pre">XspiceModel</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.add_part_to_circuit"><code class="docutils literal notranslate"><span class="pre">add_part_to_circuit()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.add_subcircuit_to_circuit"><code class="docutils literal notranslate"><span class="pre">add_subcircuit_to_circuit()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.add_xspice_io"><code class="docutils literal notranslate"><span class="pre">add_xspice_io()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.add_xspice_to_circuit"><code class="docutils literal notranslate"><span class="pre">add_xspice_to_circuit()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.convert_for_spice"><code class="docutils literal notranslate"><span class="pre">convert_for_spice()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.default_lib_paths"><code class="docutils literal notranslate"><span class="pre">default_lib_paths()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.gen_netlist"><code class="docutils literal notranslate"><span class="pre">gen_netlist()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.get_fp_lib_tbl_dir"><code class="docutils literal notranslate"><span class="pre">get_fp_lib_tbl_dir()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.load_sch_lib"><code class="docutils literal notranslate"><span class="pre">load_sch_lib()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.node"><code class="docutils literal notranslate"><span class="pre">node()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.not_implemented"><code class="docutils literal notranslate"><span class="pre">not_implemented()</span></code></a></li>
<li><a class="reference internal" href="#skidl.tools.spice.spice.parse_lib_part"><code class="docutils literal notranslate"><span class="pre">parse_lib_part()</span></code></a></li>
</ul>
</li>
</ul>

  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/rst_output/skidl.tools.spice.spice.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">SKiDL 1.2.2 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">skidl.tools.spice.spice module</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
    &#169; Copyright 2016-2024, Dave Vandenbout.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.3.7.
    </div>
  </body>
</html>